package cc.mrbird.febs.wc.controller;

import cc.mrbird.febs.wc.domain.WeiboBean;
import cc.mrbird.febs.wc.service.WeiboService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("weibo")
public class WeiboController {
    @Autowired
    WeiboService weiboService;

    /**
     * 词频列表
     * @param type 关键词类型
     * @return
     */
    @RequestMapping
    List<WeiboBean> listWeibo(@RequestParam("type") String type) {
        return weiboService.listWeiBo(type);
    }

    /**
     * 关键词类型
     * @return
     */
    @RequestMapping("type")
    List<String> listType() {
        return weiboService.listType();
    }
}
